#ifndef SPHERE_HPP
#define SPHERE_HPP

#include "shape.hpp"

class Sphere : public Shape {
public:
  Sphere( const vec3f &c, f32 r, const vec3f &col );

  vec3f center;
  f32 radius;
  vec3f color;

private:
  bool DoCalculation( const Ray &r, f32 tmin, f32 tmax, HitRecord &record,
                      bool isShadowHit ) const;

  /**
   * @brief According to the equation : length(p - c) - r*r = 0;
   */
  bool InSphere( const Ray &r, f32 tmin, f32 tmax ) const;
  
  SHAPE_HIT_SIGNITURE
};

#endif